import cn.yunhe.dao.UserDao;
import cn.yunhe.entity.User;
import cn.yunhe.util.SessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

/**
 * Created by Administrator on 2018/4/3.
 */
public class Demo1 {


    @Test
    public void testLogin() {
        SqlSession session = SessionFactoryUtil.getSession();
        UserDao userDao = session.getMapper(UserDao.class);
        User user = new User(1, "张三", "123", 22);

        User user1 = userDao.userLogin(user);
        System.out.println(user1.getUsername());


    }


}
